package com.laotou99.wmsjjj.wmsjjj;

import static org.junit.Assert.assertEquals;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.laotou99.wmsjjj.wmsjjj.bean.po.LOCPO;
import com.laotou99.wmsjjj.wmsjjj.bean.vo.LOCVO;
import com.laotou99.wmsjjj.wmsjjj.service.LOCService;

@RunWith(SpringRunner.class)
@SpringBootTest
public class WmsjjjLOCTest5 {

	@Autowired
	LOCService locService;
	
	@Test
	public void contextLoads() {
		System.out.println("first load");}
	
	@Before
	public void before() {
		System.out.println("before");}
	
	@After
	public void after() {
		System.out.println("after()");}
	
	@Test
	public void test1() { 
		System.out.println("test1");
		String arr1[]= {"A0001","A0002","A0003","A0004",};
		String arr2[]= {"普通库位1","普通库位2","普通库位3","普通库位4",};
		
		for(int i1=0;i1<arr1.length;i1++) {
			LOCVO locvo = new LOCVO();
			locvo.setLocNum(arr1[i1]);
			locvo.setLocName(arr2[i1]);
			locvo.setLocType("NORMAL");
			locvo.setLocVol(100);
			locvo.setUsedVol(0);
//			locService.saveLOC(locvo);
		}
		String arr3[]= {"B0005","B0002","B0003","B0004",};
		String arr4[]= {"自动库位1","自动库位2","自动库位3","自动库位4",};
		
		for(int i1=0;i1<arr3.length;i1++) {
			LOCVO locvo = new LOCVO();
			locvo.setLocNum(arr3[i1]);
			locvo.setLocName(arr4[i1]);
			locvo.setLocType("AUTO");
			locvo.setLocVol(100);
			locvo.setUsedVol(0);
//			locService.saveLOC(locvo);
		}
		
		assertEquals(1+1, 2);
	}

	@Test
	public void test2() { 
		System.out.println("test2");
		LOCVO vo1 =new LOCVO();
		
		assertEquals(1+1, 2);
	} 
	 
	@Test
	public void test12() { 
		System.out.println("test12");
		String str1 = locService.showAllLoc();
		System.out.println("str1-=>"+str1);
		assertEquals(1+1, 2);
	}
}
